﻿using Dexter.Async.CallContext;
using Dexter.CallContext.Async;
using Dexter.CallContext.Web;
using Dexter.Dependency;
using Dexter.Dependency.Installation;
using Dexter.Web.CallContext;

namespace Dexter.CallContext.Installer {
	public class CallContextInstaller : ILayerInstaller{
		/// <summary>
		/// 	Installs all the component needed by the assembly.
		/// </summary>
		/// <param name = "container">The container.</param>
		public void ServiceRegistration ( IDexterContainerRegister container ) {
			container.Register<IAsyncCallContext, AsyncCallContext> ( "AsyncCallContext", LifeCycle.Singleton );
			container.Register<IWebCallContext, WebCallContext> ( "WebCallContext", LifeCycle.Singleton );
			container.Register<ICallContextFactory, DexterCallContextFactory> ( "DexterCallContextFactory", LifeCycle.Singleton );
			container.Register<IDexterContext, DexterContext> ( "DexterContext", LifeCycle.Singleton );
		}

		/// <summary>
		/// 	Setups the service.
		/// </summary>
		/// <param name = "container">The container.</param>
		public void ServiceRegistrationComplete ( IDexterContainerResolver container ) {

		}

		/// <summary>
		/// 	Setups the service.
		/// </summary>
		/// <param name = "container">The container.</param>
		public void ApplicationStarted ( IDexterContainerResolver container ) {
		}
	}
}
